# Go parameters
GOCMD=GO111MODULE=on go
GOBUILD=$(GOCMD) build
GODOWNLOAD=$(GOCMD) mod download

download:
	$(GODOWNLOAD)

build:
	rm -rf target/
	mkdir target/
	cp cmd/admin/config-example.toml target/mini-admin.toml

	$(GOBUILD) -o target/admin cmd/admin/main.go

clean:
	rm -rf target/

docker:
	docker build \
	--tag bilin-mini-admin \
	--build-arg GOPRIVATE=gitee.com/quantum-force \
	--build-arg GIT_USER=$(user) \
	--build-arg GIT_TOKEN=$(token) \
	.
dev:
	go run ./cmd/admin -c cmd/admin/config-example.toml

dev2:
	go run ./cmd/admin -c cmd/admin/config-bilinbili.com.toml


run:
	nohup target/admin -c=target/mini-admin.toml  2>&1 > target/mini-admin.log &


stop:
	pkill -f target/admin
